from django.db import models
from ..models import ChatModel


# Create your models here.
class ChatRoles(models.Model):
    """
    ChatRoles
    """
    id = models.BigAutoField(primary_key=True)
    key = models.CharField(verbose_name="角色唯一标识", max_length=32, blank=False, null=False)
    name = models.CharField(verbose_name="角色名称", max_length=32, blank=False, null=False)
    context = models.TextField(verbose_name="语料信息", null=True, blank=True, default='')
    hello_msg = models.CharField(verbose_name="打招呼的消息", max_length=512, null=True, blank=True, default='')
    icon = models.CharField(verbose_name="角色图标", max_length=512, null=True, blank=True, default='')
    enable = models.BooleanField(verbose_name="当前状态", default=True, null=True, blank=True)
    sort = models.IntegerField(verbose_name="排序", null=True, blank=True, default=99)
    model_id = models.ForeignKey(verbose_name="model id", to="ChatModel", on_delete=models.SET_NULL, default='', null=True, blank=True)

    created_at = models.DateTimeField(auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)

